package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AgvStateMapper;
import com.ruoyi.system.domain.AgvState;
import com.ruoyi.system.service.IAgvStateService;
import com.ruoyi.common.support.Convert;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;


/**
 * AGV小车状态 服务层实现
 * 
 * @author ruoyi
 * @date 2019-02-22
 */
@Service
public class AgvStateServiceImpl implements IAgvStateService 
{
	@Autowired
	private AgvStateMapper agvStateMapper;

	/**
     * 查询AGV小车状态信息
     * 
     * @param agvCode AGV小车状态ID
     * @return AGV小车状态信息
     */
    @Override
    @DataSource(value = DataSourceType.SLAVE)
	public AgvState selectAgvStateById(String agvCode)
	{
	    return agvStateMapper.selectAgvStateById(agvCode);
	}
	
	/**
     * 查询AGV小车状态列表
     * 
     * @param agvState AGV小车状态信息
     * @return AGV小车状态集合
     */
	@Override
	@DataSource(value = DataSourceType.SLAVE)
	public List<AgvState> selectAgvStateList(AgvState agvState)
	{
	    return agvStateMapper.selectAgvStateList(agvState);
	}
	
    /**
     * 新增AGV小车状态
     * 
     * @param agvState AGV小车状态信息
     * @return 结果
     */
	@Override
	@DataSource(value = DataSourceType.SLAVE)
	public int insertAgvState(AgvState agvState)
	{
	    return agvStateMapper.insertAgvState(agvState);
	}
	
	/**
     * 修改AGV小车状态
     * 
     * @param agvState AGV小车状态信息
     * @return 结果
     */
	@Override
	@DataSource(value = DataSourceType.SLAVE)
	public int updateAgvState(AgvState agvState)
	{
	    return agvStateMapper.updateAgvState(agvState);
	}

	/**
     * 删除AGV小车状态对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	@DataSource(value = DataSourceType.SLAVE)
	public int deleteAgvStateByIds(String ids)
	{
		return agvStateMapper.deleteAgvStateByIds(Convert.toStrArray(ids));
	}
	
}
